<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.xxxx.com" prefix="permission"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学员列表</title>
<link rel="stylesheet" href="${path }/resources/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="${path }/resources/js/bootstrap3-editable/css/bootstrap-editable.css" />
<link rel="stylesheet"
	href="${path }/resources/css/font-awesome.min.css" />
<link rel="stylesheet"
	href="${path }/resources/js/layer/skin/default/layer.css" />
<link rel="stylesheet"
	href="${path }/resources/js/bootstrap-table/bootstrap-table.css" />
</head>
<body>
	<div style="margin-left: auto; margin-right: auto; width: 95%">
		<div class="row">
			<div id="toolbar">
				<form class="form-inline" role="form">
					<input type="hidden" value="${zx_opr}" name="opr" id="opr">
					<div class="form-group">
						<c:if test="${zx_opr=='notHf' || zx_opr=='historyzx'}">
							<div class="form-group">
								<label class="sr-only" for="searcher_date">时间</label>
								<div class="input-group">
									<div class="input-group-addon">时间</div>
									<input class="form-control form_datetime" id="search_zxDate"
										name="search_zxDate" type="text" placeholder="请输入时间">
								</div>
							</div>
						</c:if>
						<c:if test="${zx_opr=='historyzx'}">
							<div class="form-group">
								<label class="sr-only" for="searcher_name">姓名</label>
								<div class="input-group">
									<div class="input-group-addon">姓名</div>
									<input class="input-medium ui-autocomplete-input" id="empName"
										name="empName" placeholder="请输入姓名">
								</div>
							</div>
							<div class="form-group">
								<label class="sr-only" for="searcher_name">电话号码</label>
								<div class="input-group">
									<div class="input-group-addon">电话号码</div>
									<input class="input-medium ui-autocomplete-input" id="phone"
										name="phone" placeholder="请输入电话号码">
								</div>
							</div>
							<div class="form-group">
								<label class="sr-only" for="searcher_name">学校</label>
								<div class="input-group">
									<div class="input-group-addon">学校</div>
									<input class="input-medium ui-autocomplete-input" id="school"
										name="school" placeholder="请输入学校">
								</div>
							</div>
						</c:if>
						<div class="form-group">
							<label class="sr-only" for="searcher_name">咨询师</label>
							<div class="input-group">
								<div class="input-group-addon">咨询师</div>
								<select class="form-control" name="searcher_zxId"
									id="searcher_zxId">
									<option value="">--请选择咨询师--</option>
									<c:if test="${userMap != null }">
										<c:forEach var="userMap" items="${userMap}">
											<option value="${userMap.user_id}">${userMap.user_name}</option>
										</c:forEach>
									</c:if>
								</select>
							</div>
						</div>
					</div>
					<button type="button" class="btn btn-primary queryButton"
						id="search">查询</button>
				</form>
				<c:if test="${zx_opr=='zx'}">
					<button id="exportExcel" class="export-excel btn btn-info">导出</button>
				</c:if>
			</div>
			<div class="col-xs-12">
				<div class="row">
					<div class="col-xs-12">

						<div style="position: absolute; top: 15px" id="btns">
							<permission:each
								items="${sessionScope.loginUser.permissionList }" type="emp"
								var="permission">
								<a href="#" class="btn ${permission.color }  btn-sm"
									data-code="${permission.code }"> <i
									class="${permission.icon }"></i>${permission.name}
								</a>
							</permission:each>
						</div>
						<table id="table"></table>
					</div>
					<div class="modal fade" id="myModal_zx" tabindex="-1" role="dialog"
						aria-labelledby="myModalLabel" aria-hidden="true">
						<form id="myModalForm_zx" class="form-horizontal" role="form"
							action="" method="post">
							<input type="hidden" name="empId" id="empId"> <input
								type="hidden" name="descId" id="descId">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="myModalLabel">请输入备注内容</h4>
									</div>
									<div class="modal-body">
										<textarea class="form-control" id="zxDesc" name="zxDesc"
											rows="8" style="min-width: 70%"></textarea>
									</div>
									<div class="modal-body">
										<div class="control-group">
											<label>回访时间：</label> <input
												class="form-control form_datetime" id="hfDate" name="hfDate"
												type="text" placeholder="请输入回访时间">
										</div>
									</div>
									<div class="modal-body">
										<div class="control-group">
											<label>是否再回访：</label> <label> 需要<input
												name="hfStatus" class="ace" type="radio" value="0" checked />
												<span class="lbl"></span>
											</label> <label>不需要<input name="hfStatus" class="ace"
												type="radio" value="1" /> <span class="lbl"></span>
											</label>
										</div>
									</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-default"
											data-dismiss="modal">关闭</button>
										<button class="btn btn-info" type="button" id="save-btn">
											<i class="icon-ok bigger-110"></i> 保存
										</button>
									</div>
								</div>
							</div>
						</form>
					</div>
					<div class="modal fade" id="myModal_ybm" tabindex="-1"
						role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<form id="myModalForm_ybm" class="form-horizontal" role="form"
							action="" method="post">
							<input type="hidden" name="empId" id="empId_ybm"> <input
								type="hidden" name="field" value="empStatus"> <input
								type="hidden" name="newValue" id="newValue">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">&times;</button>
										<h4 class="modal-title">已报名详细内容</h4>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right"
											for="form-field-1"> 工具：</label>
										<div class="col-sm-9">
											<input type="text" id="tools" name="tools" placeholder="输入工具"
												class="col-xs-10 col-sm-5" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right"
											for="form-field-1-1">班级： </label>
										<div class="col-sm-9">
											<input type="text" id="clazz" name="clazz" placeholder="输入班级"
												class=" col-xs-10 col-sm-5" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right"
											for="form-field-1-1">学费： </label>
										<div class="col-sm-9">
											<input type="text" id="fees" name="fees" placeholder="输入学费"
												class=" col-xs-10 col-sm-5" />
										</div>
									</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-default"
											data-dismiss="modal">关闭</button>
										<button class="btn btn-info" type="button" id="save-btn_ybm">
											<i class="icon-ok bigger-110"></i> 保存
										</button>
									</div>
								</div>
							</div>
						</form>
					</div>
					<div class="modal fade" id="myModal_ytf" tabindex="-1"
						role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<form id="myModalForm_ytf" class="form-horizontal" role="form"
							action="" method="post">
							<input type="hidden" name="empId" id="empId_ytf"> 
							<input type="hidden" name="field" value="empStatus"> 
							<input type="hidden" name="newValue" id="newValue_"> 
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="myModalLabel_ytf">输入退费原因</h4>
									</div>
									<div class="modal-body">
										<textarea class="form-control" id="reason" name="reason"
											rows="8" style="min-width: 70%"></textarea>
									</div>
									<div class="modal-body">
										<div class="control-group">
											<label>是否入班：</label> <label> 是<input name="isclass"
												class="ace" type="radio" value="是" checked /> <span
												class="lbl"></span>
											</label> <label>否<input name="isclass" class="ace"
												type="radio" value="否" /> <span class="lbl"></span>
											</label>
										</div>
									</div>
									<div class="modal-footer">
										<button type="button" class="btn btn-default"
											data-dismiss="modal">关闭</button>
										<button class="btn btn-info" type="button" id="save-btn_ytf">
											<i class="icon-ok bigger-110"></i> 保存
										</button>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<%@ include file="../common.jsp"%>
	<script src="${path }/resources/js/emp/list_zx2.js"></script>
	<script type="text/javascript">
		$(function() {
			//时间插件引入
			laydate({
				elem : '#hfDate',
				value : new Date(),
				min : minDate()
			})
			laydate({
				elem : '#search_zxDate',
				value : new Date()
			})
		})
		// 设置最小可选的日期
		function minDate() {
			var now = new Date();
			return now.getFullYear() + "-" + (now.getMonth() + 1) + "-"
					+ now.getDate();
		}
	</script>
	<script type="text/javascript">
		$("#exportExcel").on("click", function(e) {
			var list = tableObj.bootstrapTable("getSelections");
			//console.log(list);
			if (list.length == 0) {
				layer.msg("请选择至少一条记录进行导出", {
					offset : 't',
					anim : 6
				});
				return;
			}
			var ids = [];
			for (var i = 0; i < list.length; i++) {
				ids[i] = list[i]["id"];
			}
			window.location.href = '../emp/excel?ids=' + ids;
		});
	</script>
</body>
</html>